package com.ellison.demo.common.controller;

import com.ellison.demo.common.entity.AjaxResult;
import com.ellison.demo.common.entity.WorkDoc;
import com.ellison.demo.common.service.WorkDocService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>TODO</p>
 *
 * @author Ellison_Pei
 * @date 2021/11/6 16:43
 * @since 1.0
 **/
@Slf4j
@RestController
@RequestMapping("api")
public class WorkDocController {

    @Resource
    private WorkDocService workDocService;

    @GetMapping("/page/{relatedBillCode}")
    public AjaxResult page(@PathVariable("relatedBillCode") String relatedBillCode){
        List<WorkDoc> pages = workDocService.pages(relatedBillCode);
        return AjaxResult.success("success", pages);
    }
}
